package com.example.myapplication2

/**
 *@author luoyu
 *@date
 *@apiNote
 */
fun max(number1: Int, number2: Int) = kotlin.math.max(number1, number2)

data class DataTest(var name: String, var age: Int) {
    val contents: String? = "hello"
    fun maxNumber(number1: Int, number2: Int) = if (number1 > number2) number1 else number2;
    fun checkNumber(number1: Number) = run {
        when (number1) {
            is Int -> println("InT")
            is Double -> println("Double")
            else -> println("都不是")
        }

    }

    fun xun() = run {
        for (i in 10 downTo 0 step 1) {
            println(i)
        }
    }

    fun test() {
        var toUpperCase = contents?.toUpperCase()
    }
}

fun main() {
    var dataTest = DataTest("zhangsan", 25)
//    var dataTest2 = DataTest("zhangsan", 25)
//    println(dataTest2.maxNumber(35, 78))
//    dataTest.checkNumber(3.5)
//    dataTest2.xun()
//    println(dataTest == dataTest2)
//    val list = mutableListOf("cy", "gd")
//    list.add("aiqing")
//    for (s in list) {
//        println(s)
//    }
//    var map = mapOf("cy" to 1, "gd" to 2)
//    for (entry in map) {
//        println(entry.key+":"+""+entry.value)
//
//    }
//    val list = listOf("Apple", "Banana", "Orange", "Pear", "Grape", "Watermelon")
//
//    var map = list.map{it->it.toUpperCase()}
//    for (i in map) {
//        println(i)
//    }
//
//    fun cylen(str: String?) = (str?.length) ?: 0
//    println(cylen("chenyong"))
    if (dataTest.contents != null) {


    }


}
